package tree.递归;

import po.TreeNode;

/**
 * @author songZiHao
 * @version 1.0.0
 * @ClassName 递增顺序搜索树897.java
 * @Description https://leetcode-cn.com/problems/increasing-order-search-tree/
 * @createTime 2021年08月02日 19:12:00
 */
public class 递增顺序搜索树897 {
	TreeNode head=new TreeNode(-1);
	TreeNode temp=head;
	public TreeNode increasingBST(TreeNode root) {
		if (root == null) {
			return null;
		}
		increasingBST(root.left);
		temp.right=new TreeNode(root.val);
		temp=temp.right;
		increasingBST(root.right);
		return head.right;
	}
}
